package com.wyj.user.feign;

import com.wyj.email.api.IEmailApi;
import com.wyj.email.entity.EmailBO;
import com.wyj.response.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

/**
 * TODO:
 *
 * @author wuyijie
 * @date 2022/2/10 6:56 PM
 */
@FeignClient(value = "email-service", path = "/email", fallback = EmailFeign.EmailFeignFallback.class)
public interface EmailFeign extends IEmailApi {

    @Component
    class EmailFeignFallback implements EmailFeign {
        /**
         * TODO: 发送邮件
         *
         * @param emailBO emailBO
         * @return java.lang.String
         * @author wuyijie
         * @date 2022/2/10 7:00 PM
         */
        @Override
        public ApiResult<Boolean> send(EmailBO emailBO) {
            return ApiResult.ok();
        }
    }


}
